import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Menu, Icon } from 'antd';

import './style.less';
import logo from '../img/mhlogo.png'

const SubMenu = Menu.SubMenu;

export default class Header extends Component {
    state = {
        currentMenu: '',
    }

    componentWillMount() {
    }

    onMenuClick = (value) => {
        // console.log(value, 'menuKey');
    }

    render() {
        const { currentMenu } = this.state;
        return (
            <div className="frame-header">
                <div className="header-logo"><Link to="/"><img height={50} src={logo} /></Link></div>
                <div className="header-menu">
                    <Menu
                        onClick={this.onMenuClick}
                        selectedKeys={[currentMenu]}
                        // defaultOpenKeys={["1"]}
                        mode="horizontal"
                    >
                        <SubMenu key="1" title={<span><Icon type="setting" />学院概况</span>}>
                            <Menu.Item key="0|0">
                                <Link to={{
                                    pathname: '/view+overview0',
                                    state: {
                                        index: '0',
                                        subIndex: '0',
                                    },
                                }}>学院简介</Link>
                            </Menu.Item>
                            <Menu.Item key="学院领导">
                                <Link to={{
                                    pathname: '/view+overview1',
                                    state: {
                                        index: '0',
                                        subIndex: '1',
                                    },
                                }}>学院领导</Link></Menu.Item>
                            <Menu.Item key="师资力量">
                                <Link to={{
                                    pathname: '/view+overview3',
                                    state: {
                                        index: '0',
                                        subIndex: '2',
                                    },
                                }}>师资力量</Link></Menu.Item>
                            <Menu.Item key="学院大事记">
                                <Link to={{
                                    pathname: '/view+overview4',
                                    state: {
                                        index: '0',
                                        subIndex: '3',
                                    },
                                }}>学院大事记</Link></Menu.Item>
                        </SubMenu>
                        <SubMenu title={<span><Icon type="setting" />党建天地</span>}>
                            <Menu.Item key="组织结构">
                                <Link to={{
                                    pathname: '/view+party0',
                                    state: {
                                        index: '1',
                                        subIndex: '0',
                                    },
                                }}>组织结构</Link></Menu.Item>
                            <Menu.Item key="党务工作">
                                <Link to={{
                                    pathname: '/view+party1',
                                    state: {
                                        index: '1',
                                        subIndex: '1',
                                    },
                                }}>党务工作</Link></Menu.Item>
                            <Menu.Item key="廉政建设">
                                <Link to={{
                                    pathname: '/view+party1',
                                    state: {
                                        index: '1',
                                        subIndex: '2',
                                    },
                                }}>廉政建设</Link></Menu.Item>
                            <Menu.Item key="工会(妇委会)活动">
                                <Link to={{
                                    pathname: '/view+party2',
                                    state: {
                                        index: '1',
                                        subIndex: '3',
                                    },
                                }}>工会(妇委会)活动</Link></Menu.Item>
                        </SubMenu>
                        <SubMenu title={<span><Icon type="setting" />人才培养</span>}>
                            <Menu.Item key="院系设置">
                                <Link to={{
                                    pathname: '/view+education0',
                                    state: {
                                        index: '2',
                                        subIndex: '0',
                                    },
                                }}>院系设置</Link></Menu.Item>
                            <Menu.Item key="本科生教育">
                                <Link to={{
                                    pathname: '/view+education1',
                                    state: {
                                        index: '2',
                                        subIndex: '1',
                                    },
                                }}>本科生教育</Link></Menu.Item>
                            <Menu.Item key="研究生教育">
                                <Link to={{
                                    pathname: '/view+education2',
                                    state: {
                                        index: '2',
                                        subIndex: '2',
                                    },
                                }}>研究生教育</Link></Menu.Item>
                            <Menu.Item key="名师寄语">
                                <Link to={{
                                    pathname: '/view+education3',
                                    state: {
                                        index: '2',
                                        subIndex: '3',
                                    },
                                }}>名师寄语</Link></Menu.Item>
                            <Menu.Item key="教学成果">
                                <Link to={{
                                    pathname: '/view+education0',
                                    state: {
                                        index: '2',
                                        subIndex: '4',
                                    },
                                }}>教学成果</Link></Menu.Item>
                        </SubMenu>
                        <SubMenu title={<span><Icon type="setting" />科学研究</span>}>
                            <Menu.Item key="科研概述">
                                <Link to={{
                                    pathname: '/view+scientific0',
                                    state: {
                                        index: '3',
                                        subIndex: '0',
                                    },
                                }}>科研概述</Link></Menu.Item>
                            <Menu.Item key="信息资源">
                                <Link to={{
                                    pathname: '/view+scientific1',
                                    state: {
                                        index: '3',
                                        subIndex: '1',
                                    },
                                }}>信息资源</Link></Menu.Item>
                            <Menu.Item key="科研项目">
                                <Link to={{
                                    pathname: '/view+scientific2',
                                    state: {
                                        index: '3',
                                        subIndex: '2',
                                    },
                                }}>科研项目</Link></Menu.Item>
                            <Menu.Item key="成果介绍">
                                <Link to={{
                                    pathname: '/view+scientific3',
                                    state: {
                                        index: '3',
                                        subIndex: '3',
                                    },
                                }}>成果介绍</Link></Menu.Item>
                            <Menu.Item key="实验室建设">
                                <Link to={{
                                    pathname: '/view+scientific4',
                                    state: {
                                        index: '3',
                                        subIndex: '3',
                                    },
                                }}>实验室建设</Link></Menu.Item>
                            <Menu.Item key="实习基地">
                                <Link to={{
                                    pathname: '/view+scientific5',
                                    state: {
                                        index: '3',
                                        subIndex: '3',
                                    },
                                }}>实习基地</Link></Menu.Item>
                        </SubMenu>
                        <SubMenu title={<span><Icon type="setting" />学生工作</span>}>
                            <Menu.Item key="职责分工">
                                <Link to={{
                                    pathname: '/view+employment0',
                                    state: {
                                        index: '4',
                                        subIndex: '0',
                                    },
                                }}>职责分工</Link></Menu.Item>
                            <Menu.Item key="规章制度">
                                <Link to={{
                                    pathname: '/view+employment1',
                                    state: {
                                        index: '4',
                                        subIndex: '1',
                                    },
                                }}>规章制度</Link></Menu.Item>
                            <Menu.Item key="思想教育">
                                <Link to={{
                                    pathname: '/view+employment2',
                                    state: {
                                        index: '4',
                                        subIndex: '2',
                                    },
                                }}>思想教育</Link></Menu.Item>
                            <Menu.Item key="创业就业">
                                <Link to={{
                                    pathname: '/view+employment3',
                                    state: {
                                        index: '4',
                                        subIndex: '3',
                                    },
                                }}>创业就业</Link></Menu.Item>
                            <Menu.Item key="国防教育">
                                <Link to={{
                                    pathname: '/view+employment4',
                                    state: {
                                        index: '4',
                                        subIndex: '4',
                                    },
                                }}>国防教育</Link></Menu.Item>
                            <Menu.Item key="学生资助">
                                <Link to={{
                                    pathname: '/view+employment5',
                                    state: {
                                        index: '4',
                                        subIndex: '5',
                                    },
                                }}>学生资助</Link></Menu.Item>
                            <Menu.Item key="心理服务">
                                <Link to={{
                                    pathname: '/view+employment6',
                                    state: {
                                        index: '4',
                                        subIndex: '6',
                                    },
                                }}>心理服务</Link></Menu.Item>
                            <Menu.Item key="联系我们">
                                <Link to={{
                                    pathname: '/view+employment7',
                                    state: {
                                        index: '4',
                                        subIndex: '7',
                                    },
                                }}>联系我们</Link></Menu.Item>
                            <Menu.Item key="文件下载">
                                <Link to={{
                                    pathname: '/view+employment8',
                                    state: {
                                        index: '4',
                                        subIndex: '8',
                                    },
                                }}>文件下载</Link></Menu.Item>
                            <Menu.Item key="新生报道">
                                <Link to={{
                                    pathname: '/view+employment9',
                                    state: {
                                        index: '4',
                                        subIndex: '9',
                                    },
                                }}>新生报道</Link></Menu.Item>
                            <Menu.Item key="在线留言">
                                <Link to={{
                                    pathname: '/view+employment10',
                                    state: {
                                        index: '4',
                                        subIndex: '10',
                                    },
                                }}>在线留言</Link></Menu.Item>
                            <Menu.Item key="在线请假">
                                <Link to={{
                                    pathname: '/view+employment11',
                                    state: {
                                        index: '4',
                                        subIndex: '11',
                                    },
                                }}>在线请假</Link></Menu.Item>
                        </SubMenu>
                    </Menu>
                </div>
            </div>
        );
    }
}